﻿using System.Windows.Input;
using MouseExtender.Resources;

namespace MouseExtender.Logic.Common
{
    public static class Commands
    {
        private static RoutedUICommand _about = null;
        private static RoutedUICommand _addFile = null;
        private static RoutedUICommand _addFolder = null;
        private static RoutedUICommand _addRunningProgram = null;
        private static RoutedUICommand _addTab = null;
        private static RoutedUICommand _addUrl = null;
        private static RoutedUICommand _applySettings = null;
        private static RoutedUICommand _cancelPopup = null;
        private static RoutedUICommand _checkUpdates = null;
        private static RoutedUICommand _delete = null;
        private static RoutedUICommand _disable = null;
        private static RoutedUICommand _dontHidePanel = null;
        private static RoutedUICommand _editItem = null;
        private static RoutedUICommand _editTab = null;
        private static RoutedUICommand _exit = null;
        private static RoutedUICommand _removeTab = null;
        private static RoutedUICommand _saveItemSettings = null;
        private static RoutedUICommand _saveTabSettings = null;
        private static RoutedUICommand _saveUrl = null;
        private static RoutedUICommand _sendToAnotherTab = null;
        private static RoutedUICommand _showSettings = null;
        private static RoutedUICommand _setLanguage = null;

        #region Commands for switching tabs
        private static RoutedCommand _changeTab = null;

        public static RoutedCommand ChangeTab
        {
            get
            {
                if (_changeTab == null)
                {
                    _changeTab = new RoutedCommand();
                }
                return _changeTab;
            }

        }

        #endregion

        public static RoutedUICommand AddFile
        {
            get
            {
                if (_addFile == null)
                {
                    _addFile = new RoutedUICommand();
                    _addFile.Text = UIResources.Menu_AddFileProgram;
                }
                return _addFile;
            }
        }

        public static RoutedUICommand AddFolder
        {
            get
            {
                if (_addFolder == null)
                {
                    _addFolder = new RoutedUICommand();
                    _addFolder.Text = UIResources.Menu_AddFolder;
                }
                return _addFolder;
            }
        }

        public static RoutedUICommand AddRunningProgram
        {
            get
            {
                if (_addRunningProgram == null)
                {
                    _addRunningProgram = new RoutedUICommand();
                    _addRunningProgram.Text = UIResources.Menu_AddRunningProgram;
                }
                return _addRunningProgram;
            }
        }

        public static RoutedUICommand AddUrl
        {
            get
            {
                if (_addUrl == null)
                {
                    _addUrl = new RoutedUICommand();
                    _addUrl.Text = UIResources.Menu_AddWebAddress;
                }
                return _addUrl;
            }
        }

        public static RoutedUICommand Delete
        {
            get
            {
                if (_delete == null)
                {
                    _delete = new RoutedUICommand();
                    _delete.Text = UIResources.Menu_Delete;
                }
                return _delete;
            }
        }

        public static RoutedUICommand ShowSettings
        {
            get
            {
                if (_showSettings == null)
                {
                    _showSettings = new RoutedUICommand();
                    _showSettings.Text = UIResources.Menu_Settings;
                }
                return _showSettings;
            }
        }

        public static RoutedUICommand ApplySettings
        {
            get
            {
                if (_applySettings == null)
                {
                    _applySettings = new RoutedUICommand();
                    _applySettings.Text = UIResources.Menu_Apply;
                }
                return _applySettings;
            }
        }

        public static RoutedUICommand CancelPopup
        {
            get
            {
                if (_cancelPopup == null)
                {
                    _cancelPopup = new RoutedUICommand();
                    _cancelPopup.Text = UIResources.Command_Cancel;
                }
                return _cancelPopup;
            }
        }

        public static RoutedUICommand Disable
        {
            get
            {
                if (_disable == null)
                {
                    _disable = new RoutedUICommand();
                    _disable.Text = UIResources.Command_Disable;
                }
                return _disable;
            }
        }

        public static RoutedUICommand DontHidePanel
        {
            get
            {
                if (_dontHidePanel == null)
                {
                    _dontHidePanel = new RoutedUICommand();
                    _dontHidePanel.Text = UIResources.Command_DontHide;
                }
                return _dontHidePanel;
            }
        }

        public static RoutedUICommand Exit
        {
            get
            {
                if (_exit == null)
                {
                    _exit = new RoutedUICommand();
                    _exit.Text = UIResources.Menu_Exit;
                }
                return _exit;
            }
        }

        public static RoutedUICommand EditItem
        {
            get
            {
                if (_editItem == null)
                {
                    _editItem = new RoutedUICommand();
                    _editItem.Text = UIResources.Command_EditItem;
                }
                return _editItem;
            }
        }

        public static RoutedUICommand SaveItemSettings
        {
            get
            {
                if (_saveItemSettings == null)
                {
                    _saveItemSettings = new RoutedUICommand();
                    _saveItemSettings.Text = UIResources.Command_SaveItem;
                }
                return _saveItemSettings;
            }
        }

        public static RoutedUICommand EditTab
        {
            get
            {
                if (_editTab == null)
                {
                    _editTab = new RoutedUICommand();
                    _editTab.Text = UIResources.Command_EditTab;
                }
                return _editTab;
            }
        }

        public static RoutedUICommand SaveTabSettings
        {
            get
            {
                if (_saveTabSettings == null)
                {
                    _saveTabSettings = new RoutedUICommand();
                    _saveTabSettings.Text = UIResources.Command_SaveTab;
                }
                return _saveTabSettings;
            }
        }

        public static RoutedUICommand SaveUrl
        {
            get
            {
                if (_saveUrl == null)
                {
                    _saveUrl = new RoutedUICommand();
                    _saveUrl.Text = UIResources.Command_SaveUrl;
                }
                return _saveUrl;
            }
        }

        public static RoutedUICommand SendToAnotherTab
        {
            get
            {
                if (_sendToAnotherTab == null)
                {
                    _sendToAnotherTab = new RoutedUICommand();
                }
                return _sendToAnotherTab;
            }
        }

        public static RoutedUICommand AddTab
        {
            get
            {
                if (_addTab == null)
                {
                    _addTab = new RoutedUICommand();
                    _addTab.Text = UIResources.Command_AddTab;
                }
                return _addTab;
            }
        }

        public static RoutedUICommand RemoveTab
        {
            get
            {
                if (_removeTab == null)
                {
                    _removeTab = new RoutedUICommand();
                    _removeTab.Text = UIResources.Command_RemoveTab;
                }
                return _removeTab;
            }
        }

        public static RoutedUICommand CheckUpdates
        {
            get
            {
                if (_checkUpdates == null)
                {
                    _checkUpdates = new RoutedUICommand();
                    _checkUpdates.Text = UIResources.Menu_CheckForUpdates;
                }
                return _checkUpdates;
            }
        }

        public static RoutedUICommand About
        {
            get
            {
                if (_about == null)
                {
                    _about = new RoutedUICommand();
                    _about.Text = UIResources.Menu_About;
                }
                return _about;
            }
        }

        public static RoutedUICommand SetLanguage
        {
            get
            {
                if (_setLanguage == null)
                {
                    _setLanguage = new RoutedUICommand();
                    _setLanguage.Text = UIResources.Command_SetLanguage;
                }
                return _setLanguage;
            }
        }
    }
}
